import createAxios from '/@/utils/axios'

// 部门管理相关API
export function getDepartmentList() {
    return createAxios({
        url: 'admin/yxerp.department/index',
        method: 'get',
    })
}

export function getDepartmentTree() {
    return createAxios({
        url: 'admin/yxerp.department/index',
        method: 'get',
    })
}

export function addDepartment(data: object) {
    return createAxios({
        url: 'admin/yxerp.department/add',
        method: 'post',
        data: data
    })
}

export function updateDepartment(data: { row: object, ids: number }) {
    return createAxios({
        url: 'admin/yxerp.department/edit',
        method: 'post',
        params: { ids: data.ids },
        data: data.row
    })
}

export function delDepartment(data: { ids: number }) {
    return createAxios({
        url: 'admin/yxerp.department/del',
        method: 'post',
        data: data
    })
} 